package com.wang.see.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.wang.see.domain.MusicRepository;
import com.wang.see.pojo.Music;

@Controller
public class MusicController {

	@Autowired
	MusicRepository musicRep;
	
	@RequestMapping("/musiclist")
	public String musicList(ModelMap map,HttpServletRequest request){
		List<Music> list=musicRep.getMusicList();
		if(list.size()>0){
			map.addAttribute("list", list);
		}
		return "music";
	}
	
}
